/**
 * 
 */
package com.module.hq.bus.player;

import com.dalonedrau.jogl.engine.GlobalConsts;
import com.dalonedrau.jogl.opengl.sprite.SpriteImageObjectFactory;
import com.module.hq.bus.globals.HQGlobals;
import com.module.hq.bus.item.weapon.Broadsword;
import com.module.hq.engine.HQCharacter;
import com.module.hq.engine.HQEquipment;
import com.module.hq.engine.HQInteractiveObject;
import com.module.hq.engine.HQInventory;
import com.module.hq.engine.HQPlayer;
import com.rpg.base.flyweight.Scriptable;

/**
 * @author Donald
 */
public final class Zull extends Scriptable<HQInteractiveObject> {
	/**
	 * {@inheritDoc}
	 */
	@Override
	public int onInit() throws Exception {
		super.getIO().addIOFlag(HQGlobals.IO_01_PC);
		HQCharacter pc = super.getIO().getPCData();
		pc.setName("Zull");
		pc.setProfession(HQGlobals.CLASS_00BARBARIAN);
		pc.setMagician(false);
		pc.setSpriteRef(
				SpriteImageObjectFactory.getInstance().getImageRefId(
						"ultima_barbarian_zull"));
		pc.setBaseAttack(0);
		pc.setBaseDefend(2);
		pc.setBaseBody(GlobalConsts.INT_008);
		pc.setBaseMaxBody(GlobalConsts.INT_008);
		pc.setBaseMind(2);
		pc.setBaseMaxMind(2);
		pc.setBaseMovement(2);
		HQInteractiveObject broadsword =
				HQEquipment.getInstance().getFreshItem(new Broadsword());
		HQEquipment.getInstance().equipItem(super.getIO(), broadsword);
		if (!HQInventory.getInstance().canBePutInInventory(
				broadsword, super.getIO())) {
			throw new Exception("COULD NOT EQUIP BROADSWORD");
		}
		HQPlayer.getInstance().computePlayerFullStats(super.getIO());
		return super.onInit();
	}
}
